package com.tensquare.web.filter;

import com.netflix.zuul.ZuulFilter;
import com.netflix.zuul.exception.ZuulException;
import org.springframework.stereotype.Component;

/**
 * Created by WF on 2020/12/24 15:06
 * 网关过滤器
 */
@Component
public class WebZuulFilter extends ZuulFilter {
    //1.过滤器执行时机
    @Override
    public String filterType() {
        return "pre";
    }

    //2.过滤器执行的顺序,值越小，越先执行
    @Override
    public int filterOrder() {
        return 0;
    }

    //3.是否执行过滤器
    @Override
    public boolean shouldFilter() {
        return true;
    }

    //4.过滤器代码
    @Override
    public Object run() throws ZuulException {

        return null;
    }
}
